﻿using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using static WebAssistant.WinUI.UIInterFaceItem;

namespace WebAssistant.BusinessLogic.Model
{
    /// <summary>
    /// 接口服务
    /// </summary>
    [SugarTable("interfaces")]
    public class Interfaces
    {
        /// <summary>
        /// ID
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        public int Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        [SugarColumn(ColumnName = "name",IsNullable = false)]
        public string Name { get; set; }

        /// <summary>
        /// 类别
        /// </summary>
        [SugarColumn(ColumnName = "category")]
        public UIInterFaceType Category { get; set; }

        /// <summary>
        /// 操作系统
        /// </summary>
        [SugarColumn(ColumnName = "os")]
        public OSType OS { get; set; }

        /// <summary>
        /// 作者
        /// </summary>
        [SugarColumn(ColumnName = "author")]
        public string Author { get; set; }

        /// <summary>
        /// 网站
        /// </summary>
        [SugarColumn(ColumnName = "website")]
        public string Website { get; set; }

        /// <summary>
        /// 技术支持
        /// </summary>
        [SugarColumn(ColumnName = "supporter")]
        public string Support { get; set; }

        /// <summary>
        /// 摘要
        /// </summary>
        [SugarColumn(ColumnName = "summary")]
        public string Summary { get; set; }

        /// <summary>
        /// 描述
        /// </summary>
        [SugarColumn(ColumnName = "description")]
        public string Description { get; set; }

        /// <summary>
        /// 版本
        /// </summary>
        [SugarColumn(ColumnName = "version")]
        public string Version { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        [SugarColumn(ColumnName = "sequence")]
        public int Sequence { get; set; }

        /// <summary>
        /// 关键字，用于安装服务和关联语言资源
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnName = "key")]
        public string Key { get; set; }

        /// <summary>
        /// 服务状态
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnName = "state")]
        public bool State { get; set; }

        /// <summary>
        /// 服务自动启动
        /// </summary>
        [SugarColumn(IsNullable = false, ColumnName = "auto_start")]
        public bool AutoStart { get; set; }

        ///// <summary>
        ///// 服务参数
        ///// </summary>
        //[SugarColumn(ColumnName = "parameters", IsJson = true)]
        //public string Parameters { get; set; }

        public Interfaces()
        {

        }

        //public Interfaces(string name, string key)
        //{
        //    this.Name = name;
        //    this.Key = key;
        //}

        
    }

    //public enum InterfaceCategory
    //{
    //    /// <summary>
    //    /// 打印机
    //    /// </summary>
    //    Printer = 0,

    //    /// <summary>
    //    /// 身份证
    //    /// </summary>
    //    IDCard = 1,
    //}
    public enum OSType
    {
        /// <summary>
        /// Windows
        /// </summary>
        Windows = 0,

        /// <summary>
        /// Linux
        /// </summary>
        Linux = 1,

        /// <summary>
        /// MacOS
        /// </summary>
        MacOS = 2,
    }
}
